package meterMonitor.biz;

import meterMonitor.mapper.MeterToolsMapper;
import meterMonitor.model.Meter;
import meterMonitor.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MeterToolsBiz {
    @Autowired
    MeterToolsMapper meterToolsMapper;

    public List<MeterTools> BtnLoadMeterClick() {
        return meterToolsMapper.sel();
    }

    public Meter getModByCode(String meterCode){
        return meterToolsMapper.getModByCode(meterCode);
    }

    public int updateCurrentQuantiry(double currentQuantiry, String deviceName) {
        return meterToolsMapper.updateCurrentQuantiry(currentQuantiry, deviceName);
    }

    public MonitorAll getMonitorToday(String meterCode, String uploadDate) {
        return meterToolsMapper.getMonitorToday(meterCode, uploadDate);
    }

    public MonitorAll getMonitorBef(String meterCode, String uploadDate) {
        return meterToolsMapper.getMonitorBef(meterCode, uploadDate);
    }

    public int updCurrentQuantiryIntervalQuantity(double currentQuantiry, double intervalQuantity, Integer PKID) {
        return meterToolsMapper.updCurrentQuantiryIntervalQuantity(currentQuantiry, intervalQuantity, PKID);
    }

    public MonitorDetailAll getDetailToday(String meterCode, String uploadDate) {
        return meterToolsMapper.getDetailToday(meterCode, uploadDate);
    }

    public MonitorDetailAll getDetailBef(String meterCode, Integer PKID) {
        return meterToolsMapper.getDetailBef(meterCode, PKID);
    }

    public int updDetailToday(double currentQuantiry, double intervalQuantity, double receiveIntervalQuantity, Integer PKID) {
        return meterToolsMapper.updDetailToday(currentQuantiry,intervalQuantity,receiveIntervalQuantity,PKID);
    }

    public MonitorHourAll getHourLatest(String meterCode,String uploadDate){
        return meterToolsMapper.getHourLatest(meterCode,uploadDate);
    }

    public MonitorHourAll getHourBef(String meterCode,Integer PKID){
        return meterToolsMapper.getHourBef(meterCode,PKID);
    }

    public int updHour(double currentQuantiry, double intervalQuantity, Integer PKID) {
        return meterToolsMapper.updHour(currentQuantiry,intervalQuantity,PKID);
    }

    public int monitorInsert(MonitorAll monitorAll){
        return meterToolsMapper.monitorInsert(monitorAll);
    }

    public MonitorHourAll getMonitorHourToday(String meterCode){
        return meterToolsMapper.getMonitorHourToday(meterCode);
    }

    public int monitorHourInsert(MonitorHourAll monitorHourAll){
        return meterToolsMapper.monitorHourInsert(monitorHourAll);
    }

    public MonitorDetailAll monitorDetailLatest(String meterCode){
        return meterToolsMapper.monitorDetailLatest(meterCode);
    }

    public int monitorDetailInsert(MonitorDetailAll monitorDetailAll){
        return meterToolsMapper.monitorDetailInsert(monitorDetailAll);
    }

    public List<MonitorAll> getMonitorByUploadDate(String uploadDate){
        return meterToolsMapper.getMonitorByUploadDate(uploadDate);
    }

    public List<MonitorAll> getMonitorBymeterCode(String meterCode){
        return meterToolsMapper.getMonitorBymeterCode(meterCode);
    }

    public List<MeterStatus> getMeterStatusAll(String uploadDate){
        return meterToolsMapper.getMeterStatusAll(uploadDate);
    }

}
